package ads;

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {
	public static void main(String args[]){
		Set<String> words = new TreeSet<>();
		Scanner sc = new Scanner(System.in);
		while(true){
		String word = sc.next();
		if(word.equals("!!!!!"))
			break;
		words.add(word);
		}
		System.out.println(words.size());
		int i = 0;
		for(String e : words){
			if(i++<10)
				System.out.println(e);
		}
	}
}
